from rest_framework import serializers
from .models import Task
from rest_framework import serializers
from .models import KnowledgeBase, KnowledgeBaseFile
from .models import ProcessingData  # 确保导入了 ProcessingData 模型

class TaskSerializer(serializers.ModelSerializer):
    class Meta:
        model = Task
        fields = '__all__'

class TextEmbeddingSerializer(serializers.Serializer):
    text = serializers.CharField(required=True)

class QuestionSerializer(serializers.Serializer):
    question = serializers.CharField(required=True)
    
class KnowledgeBaseSerializer(serializers.ModelSerializer):
    class Meta:
        model = KnowledgeBase
        fields = '__all__'
class KnowledgeBaseFileSerializer(serializers.ModelSerializer):
    class Meta:
        model = KnowledgeBaseFile
        fields = '__all__'
class ProcessingDataSerializer(serializers.ModelSerializer):
    class Meta:
        model = ProcessingData
        fields = '__all__'  # 或者列出具体字段